Optimal. Leaf size=62 \[ -\frac {d^2 x}{b^2}-\frac {(b c+a d)^2 \log (a-b x)}{2 a b^3}+\frac {(b c-a d)^2 \log (a+b x)}{2 a b^3} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.03, antiderivative size = 62, normalized size of antiderivative = 1.00, number of steps
used = 2, number of rules used = 1, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.043, Rules used = {84}
\begin {gather*} -\frac {(a d+b c)^2 \log (a-b x)}{2 a b^3}+\frac {(b c-a d)^2 \log (a+b x)}{2 a b^3}-\frac {d^2 x}{b^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 84
Rubi steps
\begin {align*} \int \frac {(c+d x)^2}{(a-b x) (a+b x)} \, dx &=\int \left (-\frac {d^2}{b^2}+\frac {(b c+a d)^2}{2 a b^2 (a-b x)}+\frac {(-b c+a d)^2}{2 a b^2 (a+b x)}\right ) \, dx\\ &=-\frac {d^2 x}{b^2}-\frac {(b c+a d)^2 \log (a-b x)}{2 a b^3}+\frac {(b c-a d)^2 \log (a+b x)}{2 a b^3}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.02, size = 54, normalized size = 0.87 \begin {gather*} \frac {-2 a b d^2 x-(b c+a d)^2 \log (a-b x)+(b c-a d)^2 \log (a+b x)}{2 a b^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.12, size = 84, normalized size = 1.35
method | result | size |
norman | \(-\frac {d^{2} x}{b^{2}}+\frac {\left (a^{2} d^{2}-2 a b c d +b^{2} c^{2}\right ) \ln \left (b x +a \right )}{2 b^{3} a}-\frac {\left (a^{2} d^{2}+2 a b c d +b^{2} c^{2}\right ) \ln \left (-b x +a \right )}{2 b^{3} a}\) | \(82\) |
default | \(-\frac {d^{2} x}{b^{2}}+\frac {\left (a^{2} d^{2}-2 a b c d +b^{2} c^{2}\right ) \ln \left (b x +a \right )}{2 b^{3} a}+\frac {\left (-a^{2} d^{2}-2 a b c d -b^{2} c^{2}\right ) \ln \left (-b x +a \right )}{2 a \,b^{3}}\) | \(84\) |
risch | \(-\frac {d^{2} x}{b^{2}}+\frac {a \ln \left (-b x -a \right ) d^{2}}{2 b^{3}}-\frac {\ln \left (-b x -a \right ) c d}{b^{2}}+\frac {\ln \left (-b x -a \right ) c^{2}}{2 b a}-\frac {a \ln \left (b x -a \right ) d^{2}}{2 b^{3}}-\frac {\ln \left (b x -a \right ) c d}{b^{2}}-\frac {\ln \left (b x -a \right ) c^{2}}{2 b a}\) | \(116\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 82, normalized size = 1.32 \begin {gather*} -\frac {d^{2} x}{b^{2}} + \frac {{\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left (b x + a\right )}{2 \, a b^{3}} - \frac {{\left (b^{2} c^{2} + 2 \, a b c d + a^{2} d^{2}\right )} \log \left (b x - a\right )}{2 \, a b^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.48, size = 76, normalized size = 1.23 \begin {gather*} -\frac {2 \, a b d^{2} x - {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left (b x + a\right ) + {\left (b^{2} c^{2} + 2 \, a b c d + a^{2} d^{2}\right )} \log \left (b x - a\right )}{2 \, a b^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 112 vs.
\(2 (51) = 102\).
time = 0.34, size = 112, normalized size = 1.81 \begin {gather*} - \frac {d^{2} x}{b^{2}} + \frac {\left (a d - b c\right )^{2} \log {\left (x + \frac {2 a^{2} c d + \frac {a \left (a d - b c\right )^{2}}{b}}{a^{2} d^{2} + b^{2} c^{2}} \right )}}{2 a b^{3}} - \frac {\left (a d + b c\right )^{2} \log {\left (x + \frac {2 a^{2} c d - \frac {a \left (a d + b c\right )^{2}}{b}}{a^{2} d^{2} + b^{2} c^{2}} \right )}}{2 a b^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 1.70, size = 84, normalized size = 1.35 \begin {gather*} -\frac {d^{2} x}{b^{2}} + \frac {{\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left ({\left | b x + a \right |}\right )}{2 \, a b^{3}} - \frac {{\left (b^{2} c^{2} + 2 \, a b c d + a^{2} d^{2}\right )} \log \left ({\left | b x - a \right |}\right )}{2 \, a b^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.18, size = 81, normalized size = 1.31 \begin {gather*} \frac {\ln \left (a+b\,x\right )\,\left (a^2\,d^2-2\,a\,b\,c\,d+b^2\,c^2\right )}{2\,a\,b^3}-\frac {d^2\,x}{b^2}-\frac {\ln \left (a-b\,x\right )\,\left (a^2\,d^2+2\,a\,b\,c\,d+b^2\,c^2\right )}{2\,a\,b^3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________